#include"LeftPane.h" 

#include"FileSystemView.h"
#include"DatabaseController.h"

LeftPane::LeftPane(QWidget *parent):QTabWidget(parent){
	m_fileSystemView = new FileSystemView(this);
	addTab(m_fileSystemView, "Files");
	connect(m_fileSystemView, SIGNAL(addSong(QPointer<Song>)), this, SLOT(slotAddSong(QPointer<Song>)));
	
	m_databaseController = new DatabaseController(this);
	addTab(m_databaseController->widget(), "Music");
	connect(m_databaseController->widget(), SIGNAL(addToPlaylist(QList<QString>)), this, SLOT(slotAddSongs(QList<QString>)));
}

LeftPane::~LeftPane(){
	
}

void LeftPane::slotAddSong(QPointer<Song> song){
	emit addSong(song);
}

void LeftPane::slotAddSongs(QList<QString> songs){
	emit addSongs(songs);
}

void LeftPane::slotSongAdded(QPointer<Song> song){
	m_databaseController->addSongToDB(song);
}